#include "Common.hpp"

class Client
{
public:
    Client()
        : _fd(g_defaultfd)
    {
    }

    void OpenForWrite()
    {
        _fd = openPipe("Client",g_openForWrite);
    }

    // 客户端写
    int WritePipe(const std::string &str)
    {
        int n = ::write(_fd, str.c_str(), str.size());
        return n;
    }

    ~Client()
    {
        closePipe("Client",_fd);
    }

private:
    int _fd;
};
